Skip to content

feat: support searching and sorting items by enchantment name and level#17

Open
ags816710 wants to merge 2 commits into
DerMoha:mainfrom
ags816710:feat/enchantment-search-and-sort
Open

feat: support searching and sorting items by enchantment name and level#17
ags816710 wants to merge 2 commits into
DerMoha:mainfrom
ags816710:feat/enchantment-search-and-sort

Conversation

@ags816710

Copy link
Copy Markdown

Adds the ability to search for items in the terminal by their enchantment names and levels (e.g., typing "Fortune 3" or "Sharpness IV"). It also updates the alphabetical sorting logic so that enchanted books and gear are grouped by their base name, but sorted logically by their specific enchantment and level (e.g., Sharpness I appears before Sharpness V).

Roman numerals are currently hardcoded from I -> X, might change this to something better if needed though.

ags816710 added 2 commits June 9, 2026 18:12
…e 3", "fortune iii", etc)

- Update enchantment matching logic to parse search queries word-by-word.
- Add Roman numeral conversion to support Minecraft's native level formatting (I, II, III, etc.) - hardcoded for now
- Ensure both regular enchanted items and Enchanted Books are correctly filtered by their specific enchantment levels.
- Add `getSortName` utility to append the primary enchantment name to the base item name and and zero-padded level for sorting.
- Ensures enchanted books remain grouped together under "Enchanted Book" while sorting logically by their specific enchantment (e.g., "Enchanted Book - Mending" before "Enchanted Book - Sharpness").
- Ensures enchanted books display in ascending order of level (e.g. Efficiency IV appears after Efficiency II)
- Applies to both stored enchants (books) and regular enchanted gear.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant